Repository navigation
fix(dav): Skip CalDAV activities for resource and room calendars - #67687
Open
kukanggg89 wants to merge 1 commit into
Open
kukanggg89 wants to merge 1 commit into
kukanggg89 wants to merge 1 commit into
Conversation
The CalDAV activity backend took the calendar owner from the last segment of principaluri without checking the principal type, so events delivered to a resource or room calendar created activities for a user that does not exist. Long resource IDs failed outright with the affected user over 64 characters and an error in the log. Return early from the methods that derive the owner from principaluri unless the principal starts with principals/users/: triggerCalendarActivity, onCalendarUpdateShares, onTouchCalendarObject and onMovedCalendarObject. A move between two calendars with different owners still reports the delete side for a user calendar through onTouchCalendarObject. Adds unit tests in BackendTest: resource and room principals (including a resource ID over 64 characters) create no activity in any of the four methods, plus a positive test that a user calendar still gets its activity. The existing fixtures used the unrealistic principaluri principal/user/admin, updated to principals/users/admin. Signed-off-by: parel <farelalfarizi89@gmail.com> Assisted-by: Muse:Muse Spark 1.3
kukanggg89
requested review from
SebastianKrupinski and
hamza221
as code owners
December 4, 2026 07:34
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The CalDAV activity backend took the calendar owner from the last segment of
principaluriwithout checking the principal type, so an event delivered to a resource or room calendar created activities for a user that does not exist. For long resource IDs the activity failed outright (affected user over 64 characters) and the failure landed in the log as an error.The four methods that derive the owner from
principalurinow return early unless the principal starts withprincipals/users/:triggerCalendarActivity,onCalendarUpdateShares,onTouchCalendarObject, andonMovedCalendarObject. The new check lives in one helper,isUserCalendar(). One edge case stays working: moving an object between two calendars with different owners still reports the delete side for a user calendar, because the cross-owner path goes throughonTouchCalendarObjectand each side is checked on its own.The existing test fixtures used
principal/user/admin, which is not a real principal URI; they now useprincipals/users/admin.TODO
None.
Checklist
3. to review, feature component) (n/a: maintainers set labels)stable32) (n/a: maintainers set the milestone)AI (if applicable)
Drafted with help from Claude. I reviewed and revised every change myself before opening this PR.
Verification
Five new test methods (13 cases) in
BackendTest: resource and room principals, including a resource ID of 84 characters, create no activity intriggerCalendarActivity,onTouchCalendarObject,onCalendarUpdateShares, andonMovedCalendarObject, plus a positive test that a user calendar still gets its object activity. The guard logic was checked by hand against everyprincipalurivalue in the test file. The test suite was not run locally (no PHP toolchain in this environment); CI runs it. Not validated on a live instance.